<head>
<link rel="stylesheet" type="text/css" href="include/leftNav.css" />
</head>
<?php
if (!defined('WEB_ROOT')) {
	exit;
}

// get all categories
$categories = fetchCategories();

// format the categories for display
$categories = formatCategories($categories, $catId);
	require_once '/function/function.php';
	//include "/function/functionleft.php";
	
?>
<ul>
<li><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Sản phẩm</a></li>
<?php
$catList = buildCategoryOptions($catId);
foreach ($categories as $category) {
	extract($category);
	// now we have $cat_id, $cat_parent_id, $cat_name
	
	$level = ($cat_parent_id == 0) ? 1 : 2;
    $url   = $_SERVER['PHP_SELF'] . "?c=$cat_id";

	// for second level categories we print extra spaces to give
	// indentation look
	if ($level == 2) {
		$cat_name = '&nbsp; &nbsp; &raquo;&nbsp;' . $cat_name;
	}
	
	// assign id="current" for the currently selected category
	// this will highlight the category name
	$listId = '';
	if ($cat_id == $catId) {
		$listId = ' id="current"';
	}
?>
<li <?php echo $listId; ?>><a href="<?php echo $url; ?>"><?php echo $cat_name; ?></a></li>
<?php
}
?>
</ul>

<div id="searchproduct">
		<div id="title_lr">
			<h3 id="h3tk">Tìm sản phẩm</h3>
		</div>
		<div id="formselect">
		<form name="form_search" method="post" action="index.php?pa=timkiem" onsubmit="return checkuser();" >
			<select name="manufacturer">
				<option value="" selected="selected">Chọn nhà sản xuất</option>
			   <?php echo $catList; ?>
			</select>
			<select name="price">
			<option value="" selected="selected">Chọn khoảng giá</option>
			<option value="1" ><100$</option>
			<option value="2" >100$ - 500$</option>
			<option value="3" >>500$</option>
			</select> 
			<!--<select name="operationsystem">
			<option  value="" selected="selected">Chọn hệ điều hành</option>
			<?php //chonHeDieuHanh() ?>
			</select>
			<div id="checkbox">
			<?php //chonChucNang()?>
			</div>-->
			<div id="select">
				<input value="Tìm kiếm" name="select" type="submit" />
			</div>
		</form>
		
		
		</div><!--ket thuc formsearch-->
	</div><!--ket thuc searchproduct-->
